package com.clerkq.FlvPlayer
{
	import com.library.core.IDisposable;
	import com.library.core.UIObject;

	public class FlvPlayer extends UIObject implements IDisposable
	{
		private var _vPlayer:VideoPlayer;
		private var _vDisplay:VideoDisplay;
		private var _vDecorate:VideoDecorate;
		private var _vController:VideoController;
		
		public function FlvPlayer()
		{
			super();
			
			_vPlayer = new VideoPlayer();
			_vDisplay = new VideoDisplay(730, 405);
			_vDecorate = new VideoDecorate();
			_vDisplay.x = 9.5;
			_vDisplay.y = 10;
			_vController = new VideoController();
			_vController.player = _vPlayer;
			_vController.video = _vDisplay;
			_vController.decorate = _vDecorate;
			
			addChild(_vPlayer);
			addChild(_vDisplay);
			addChild(_vDecorate);
		}
		
		public function Play(url:String):void{
			_vController.url = url;
		}
		public function Pause():void{
			_vController.pause();
		}
		
		public function Dispose():void
		{
			_vPlayer.Dispose();
			_vDisplay.Dispose();
			_vDecorate.Dispose();
			_vController.Dispose();
		}
	}
}